#ifndef MYTRANSLATOR_H
#define MYTRANSLATOR_H

#include <QTranslator>
#include <QStringList>
#include <QtDebug>
class QComboBox;

class MyTranslator : public QObject
{
	Q_OBJECT

public:
	MyTranslator(QObject* parent = 0);
	void loadFiles();
	inline QStringList foundLangs() const { return this->files_langs.keys(); }
//	inline QStringList foundLangs() { return QStringList(); }
private:
	QStringList langIndexes;
	QHash<QString, QStringList> files_langs;
	QList<QTranslator*> currentTranslations;
	QString currentTranslationLang;
	void addLang(const QString &langName);

public slots:
	void retranslate(const QString &languageName);
	inline void retranslate(const int index) { this->retranslate(this->langIndexes.at(index)); }

signals:
	void retranslateUi();

};




#endif // MYTRANSLATOR_H
